

#include "mvr.h"
#include <iostream>
#include "solid.h"
#include "face.h"
#include "loop.h"
#include "point.h"
#include "vertex.h"
#include "halfedge.h"


MVR::MVR( Face* _f, int _v, double _x, double _y, double _z )
: face( _f )
, v( _v )
, x( _x )
, y( _y )
, z( _z )
{

}


void
MVR::execute()
{
  std::cout << "\nMVR::execute() \n";

  Solid* solid = face->getSolid();

  Loop* newloop = new Loop(face);
  Point* point = new Point(x, y, z);
  Vertex* newvertex = new Vertex(point,solid);
  HalfEdge* newhe = new HalfEdge();

  newloop->setLedg( newhe );
  newhe->setWloop(newloop);
  newhe->setNxt(newhe);
  newhe->setPrv(newhe);
  newhe->setVtx(newvertex);
  newhe->setEdg(NULL);
  newvertex->setVertexno(v);
  newvertex->setVedge(newhe);


}


void
MVR::unExecute()
{
  std::cout << "\nMVR::unExecute() NOT IMPLEMENTED!\n";
}







